package com.heiye.count.biz.domain.mapper;

import com.heiye.count.biz.domain.dataobject.QuizCountDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface QuizCountDOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(QuizCountDO record);

    int insertSelective(QuizCountDO record);

    QuizCountDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(QuizCountDO record);

    int updateByPrimaryKey(QuizCountDO record);

    /**
     * 添加或更新粉丝总数
     *
     * @param count
     * @param quizId
     * @return
     */
    int insertOrUpdateFansTotalByQuizId(@Param("count") Integer count, @Param("quizId") Long quizId);


    /**
     * 添加问题计数记录或更新问题点赞数
     *
     * @param count
     * @param quizId
     * @return
     */
    int insertOrUpdateLikeTotalByQuizId(@Param("count") Integer count, @Param("quizId") Long quizId);

    /**
     * 根据问题 ID 批量查询
     *
     * @param quizIds
     * @return
     */
    List<QuizCountDO> selectByQuizIds(@Param("quizIds") List<Long> quizIds);

    /**
     * 根据问题 ID 查询
     *
     * @param quizId
     * @return
     */
    QuizCountDO selectByQuizId(Long quizId);

    /**
     * 添加记录或更新问题评论数
     *
     * @param count
     * @param quizId
     * @return
     */
    int insertOrUpdateCommentTotalByQuizId(@Param("count") int count, @Param("quizId") Long quizId);

}